<%@ page contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" trimDirectiveWhitespaces="true"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>자바 표준 태크 라이브러리 : JSTL</title>
</head>
<body>
<h1>자바 표준 태크 라이브러리 : JSTL</h1>
	<h3>functions : 함수라이브러리</h3>
	<p>contains</p>
	<p>startsWith / endsWith</p>
	<p>escapeXml</p>
	<p>indexOf</p>
	<p>length</p>
	<p>trim</p>
	<p>substring</p>
	<p>split</p>

	<c:set var="jumin" value="123456-1234567"/>
	<c:set var="html" value="<h1>sup~jstl!!</h1>"/>
	<c:set var="token" value="1,2,3,4,5,6,7,8,9,0"/>
	<c:set var="action" value="game__mania"/>
	
	<p>문자열 길이 : ${fn:length(jumin)}</p>
	<p>문자열 추출 : 성별 - ${fn:substring(jumin,7,8)}</p>
	<p>문자 포함 여부 : ${fn:indexOf(jumin,'-')},
					${fn:indexOf(jumin,'*')}</p>
	<p>특정 문자열로 시작하는지 여부 : ${fn:startsWith(action,'game')},
							 ${fn:startsWith(actoin,'mania')}</p>
	<p>특정 문자열로 끝나는지 여부 : ${fn:endsWith(action,'mania')},
							${fn:endsWith(action,'game')}</p>
	<p>문자 포함 여부 : ${fn:contains(jumin,7)},
					${fn:contains(jumin,8)}</p>
	<p>여백 제거 여부 :  ${('         aaa        ')},
				    ${fn:trim('         aaa        ')}</p>
	<p>문자열을 문자들로 나눔 : ${fn:split(token,',')},
		<c:forEach var="t" items="${fn:split(token,',')}">
		${t}</c:forEach>
	
	</p>
	<p>문자열을 eacaping 함 : ${html}, ${fn:escapeXml(html)}</p>
	
</body>
</html>